﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using ArchivesManagement;
using Model;
/// <summary>
///活动奖励信息业务逻辑
/// </summary>
/// 
namespace ArchivesManagementBL
{

    public class ActivityAwardInformationBL
    {
        ActivityAwardInformationService activityAwardInformationService = new ActivityAwardInformationService();
        public ActivityAwardInformationBL()
        {

        }

        //根据档案编号获取所有活动奖励信息业务逻辑
        public IList<ActivityAwardInformation> GetActivityAwardInformationByFileNumber(string fileNumber)
        {
            try
            {
                return activityAwardInformationService.GetActivityAwardInformationByFileNumber(fileNumber);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }

        //得到档案编号
        public string GetFileNumber()
        {
            string fileNumber = string.Empty;
            try
            {
                fileNumber = activityAwardInformationService.GetFileNumber();

            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            return fileNumber;
        }

        //获取活动奖励信息业务逻辑
        public IList<ActivityAwardInformation> GetActivityAwardInformation()
        {
            try
            {
                return activityAwardInformationService.GetActivityAwardInformation();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }

        //根据奖励ID得到客房实体对象
        public ActivityAwardInformation GetActivityAwardInformationByID(int id)
        {
            try
            {
                return activityAwardInformationService.GetActivityAwardInformationByID(id);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }

        //根据奖励ID删除活动奖励信息
        public void DeleteActivityAwardInformationByStudentId(int id)
        {
            try
            {
                activityAwardInformationService.DeleteActivityAwardInformationByStudentId(id);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }



        //修改活动奖励信息业务逻辑
        public int  ModifyActivityAwardInformation(ActivityAwardInformation activityAwardInformation)
        {
            try
            {
               return  activityAwardInformationService.ModifyActivityAwardInformation(activityAwardInformation);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }

        //增加活动奖励信息业务逻辑
        public int AddActivityAwardInformation(ActivityAwardInformation activityAwardInformation)
        {
            try
            {
                return activityAwardInformationService.AddActivityAwardInformation(activityAwardInformation);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }

        //根据档案编号得到奖励ID
        public int GetIDByFileNmuber(string fileNumber)
        {
            int id;
            try
            {
                id = activityAwardInformationService.GetIDByFileNmuber(fileNumber);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            return id;
        }

        public string GetFileNumberByID(int id)
        {
            string fileNumber = string.Empty;
            try
            {
                fileNumber = activityAwardInformationService.GetFileNumberByID(id);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            return fileNumber;
        }
    }
}
